/* eslint-disable react/prefer-stateless-function */
import React, { Component } from 'react'
import { Descriptions, Divider, Table } from 'antd'
import styles from './loading.less'
import loadingImg from '@/assets/loading.png'

// 新颜风控
class XinyanReport extends Component {
  render() {
    const { xydata1 = {}, xydata2 = {}, xydata3 = {} } = this.props

    if (!xydata2?.apply_report_detail?.A22160001)
      return (
        <div className={styles.loading}>
          <img src={loadingImg} />
        </div>
      )

    const columns = [
      {
        title: '逾期时间',
        dataIndex: 'endDay'
      },
      {
        title: '逾期账期数',
        dataIndex: 'billType'
      },
      {
        title: '逾期金额',
        dataIndex: 'endMoney'
      },
      {
        title: '是否结清',
        dataIndex: 'endFlag'
      }
    ]

    return (
      <>
        <Divider style={{ fontSize: '20px' }}>风险探针</Divider>
        <Descriptions column={4} layout="" bordered>
          <Descriptions.Item label="最大逾期金额">
            {(xydata1 && xydata1.max_overdue_amt) || '-'}
          </Descriptions.Item>
          <Descriptions.Item label="最长逾期天数">
            {(xydata1 && xydata1.max_overdue_days) || '-'}
          </Descriptions.Item>
          <Descriptions.Item label="最近逾期时间" span={2}>
            {(xydata1 && xydata1.latest_overdue_time) || '-'}
          </Descriptions.Item>
          <Descriptions.Item label="当前逾期机构数">
            {(xydata1 && xydata1.currently_overdue) || '-'}
          </Descriptions.Item>
          <Descriptions.Item label="当前履约机构数">
            {(xydata1 && xydata1.currently_performance) || '-'}
          </Descriptions.Item>
          <Descriptions.Item label="异常还款机构数">
            {(xydata1 && xydata1.acc_exc) || '-'}
          </Descriptions.Item>
          <Descriptions.Item label="睡眠机构数">
            {xydata1 && xydata1.acc_sleep}
          </Descriptions.Item>
        </Descriptions>
        {/* <Divider style={{ fontSize: '20px', marginTop: 50 }}>
          共债档案（全景档案）
        </Divider>
        <Descriptions column={4} title="结果详情" bordered>
          <Descriptions.Item label="近1月共债机构数">
            {xydata3.current_org_count || '-'}
          </Descriptions.Item>
          <Descriptions.Item label="近1月共债订单数">
            {xydata3.current_order_count || '-'}
          </Descriptions.Item>
          <Descriptions.Item label="近1月共债订单已还款金额">
            {xydata3.current_order_amt || '-'}
          </Descriptions.Item>
          <Descriptions.Item label="近1月共债订单金额">
            {xydata3.current_order_lend_amt || '-'}
          </Descriptions.Item>
        </Descriptions>
        <Descriptions
          style={{ marginTop: 20 }}
          column={3}
          title="历史共债"
          bordered
        >
          <Descriptions.Item label="共债统计时间范围">
            {xydata3.totaldebt_date || '-'}
          </Descriptions.Item>
          <Descriptions.Item label="共债机构数">
            {xydata3.totaldebt_org_count || '-'}
          </Descriptions.Item>
          <Descriptions.Item label="共债订单数">
            {xydata3.totaldebt_order_count || '-'}
          </Descriptions.Item>
          <Descriptions.Item label="共债订单已还款金额">
            {xydata3.totaldebt_order_amt || '-'}
          </Descriptions.Item>
          <Descriptions.Item label="疑似借新还旧">
            {xydata3.new_or_old || '-'}
          </Descriptions.Item>
          <Descriptions.Item label="共债订单金额">
            {xydata3.totaldebt_order_lend_amt || '-'}
          </Descriptions.Item>
        </Descriptions>
        <Descriptions
          style={{ marginTop: 20 }}
          column={3}
          title="逾期总览"
          bordered
        >
          <Descriptions.Item label="逾期机构数">
            {xydata3.totaldebt_date || '-'}
          </Descriptions.Item>
          <Descriptions.Item label="逾期订单数">
            {xydata3.totaldebt_org_count || '-'}
          </Descriptions.Item>
          <Descriptions.Item label="逾期总金额">
            {xydata3.totaldebt_order_count || '-'}
          </Descriptions.Item>
        </Descriptions>

        <Table
          style={{ marginTop: 40 }}
          dataSource={xydata3.debt_detail}
          columns={columns}
          pagination={false}
        /> */}

        <Divider style={{ fontSize: '20px', marginTop: 50 }}>申请雷达</Divider>
        <Descriptions column={3}>
          <Descriptions.Item label="申请准入分">
            {xydata2.apply_report_detail &&
              xydata2.apply_report_detail.A22160001}
          </Descriptions.Item>
          <Descriptions.Item label="申请准入置信度">
            {xydata2.apply_report_detail &&
              xydata2.apply_report_detail.A22160002}
          </Descriptions.Item>
          <Descriptions.Item label="申请命中机构数">
            {xydata2.apply_report_detail &&
              xydata2.apply_report_detail.A22160003}
          </Descriptions.Item>
          <Descriptions.Item label="申请命中消金类机构数">
            {xydata2.apply_report_detail &&
              xydata2.apply_report_detail.A22160004}
          </Descriptions.Item>
          <Descriptions.Item label="申请命中网络贷款类机构数">
            {xydata2.apply_report_detail &&
              xydata2.apply_report_detail.A22160005}
          </Descriptions.Item>
          <Descriptions.Item label="机构总查询次数">
            {xydata2.apply_report_detail &&
              xydata2.apply_report_detail.A22160006}
          </Descriptions.Item>
          <Descriptions.Item label="最近一次查询时间">
            {xydata2.apply_report_detail &&
              xydata2.apply_report_detail.A22160007}
          </Descriptions.Item>
          <Descriptions.Item label="近1个月机构总查询笔数">
            {xydata2.apply_report_detail &&
              xydata2.apply_report_detail.A22160008}
          </Descriptions.Item>
          <Descriptions.Item label="近3个月机构总查询笔数">
            {xydata2.apply_report_detail &&
              xydata2.apply_report_detail.A22160009}
          </Descriptions.Item>
          <Descriptions.Item label="近6个月机构总查询笔数">
            {xydata2.apply_report_detail &&
              xydata2.apply_report_detail.A22160010}
          </Descriptions.Item>
        </Descriptions>

        <Divider style={{ fontSize: '20px', marginTop: 50 }}>行为雷达</Divider>
        <Descriptions column={3}>
          <Descriptions.Item label="贷款行为分">
            {xydata2.behavior_report_detail &&
              xydata2.behavior_report_detail.B22170001}
          </Descriptions.Item>
          <Descriptions.Item label="贷款行为置信度">
            {xydata2.behavior_report_detail &&
              xydata2.behavior_report_detail.B22170051}
          </Descriptions.Item>
          <Descriptions.Item label="正常还款订单数占贷款总订单数比例">
            {xydata2.behavior_report_detail &&
              xydata2.behavior_report_detail.B22170034}
          </Descriptions.Item>
          <Descriptions.Item label="近1个月贷款笔数">
            {xydata2.behavior_report_detail &&
              xydata2.behavior_report_detail.B22170002}
          </Descriptions.Item>
          <Descriptions.Item label="近3个月贷款笔数">
            {xydata2.behavior_report_detail &&
              xydata2.behavior_report_detail.B22170003}
          </Descriptions.Item>
          <Descriptions.Item label="近6个月贷款笔数">
            {xydata2.behavior_report_detail &&
              xydata2.behavior_report_detail.B22170004}
          </Descriptions.Item>
          <Descriptions.Item label="近12个月贷款笔数">
            {xydata2.behavior_report_detail &&
              xydata2.behavior_report_detail.B22170005}
          </Descriptions.Item>
          <Descriptions.Item label="近24个月贷款笔数" span={2}>
            {xydata2.behavior_report_detail &&
              xydata2.behavior_report_detail.B22170006}
          </Descriptions.Item>
          <Descriptions.Item label="近1个月贷款总金额">
            {xydata2.behavior_report_detail &&
              xydata2.behavior_report_detail.B22170007}
          </Descriptions.Item>
          <Descriptions.Item label="近3个月贷款总金额">
            {xydata2.behavior_report_detail &&
              xydata2.behavior_report_detail.B22170008}
          </Descriptions.Item>
          <Descriptions.Item label="近6个月贷款总金额">
            {xydata2.behavior_report_detail &&
              xydata2.behavior_report_detail.B22170009}
          </Descriptions.Item>
          <Descriptions.Item label="近12个月贷款总金额">
            {xydata2.behavior_report_detail &&
              xydata2.behavior_report_detail.B22170010}
          </Descriptions.Item>
          <Descriptions.Item label="近24个月贷款总金额" span={2}>
            {xydata2.behavior_report_detail &&
              xydata2.behavior_report_detail.B22170011}
          </Descriptions.Item>
          <Descriptions.Item label="近1个月贷款机构数">
            {xydata2.behavior_report_detail &&
              xydata2.behavior_report_detail.B22170016}
          </Descriptions.Item>
          <Descriptions.Item label="近3个月贷款机构数">
            {xydata2.behavior_report_detail &&
              xydata2.behavior_report_detail.B22170017}
          </Descriptions.Item>
          <Descriptions.Item label="近6个月贷款机构数">
            {xydata2.behavior_report_detail &&
              xydata2.behavior_report_detail.B22170018}
          </Descriptions.Item>
          <Descriptions.Item label="近12个月贷款机构数">
            {xydata2.behavior_report_detail &&
              xydata2.behavior_report_detail.B22170019}
          </Descriptions.Item>
          <Descriptions.Item label="近24个月贷款机构数" span={2}>
            {xydata2.behavior_report_detail &&
              xydata2.behavior_report_detail.B22170020}
          </Descriptions.Item>
          <Descriptions.Item label="近12个月贷款金额在1k及以下的笔数">
            {xydata2.behavior_report_detail &&
              xydata2.behavior_report_detail.B22170012}
          </Descriptions.Item>
          <Descriptions.Item label="近12个月贷款金额在1k-3k的笔数">
            {xydata2.behavior_report_detail &&
              xydata2.behavior_report_detail.B22170013}
          </Descriptions.Item>
          <Descriptions.Item label="近12个月贷款金额在3k-10k的笔数">
            {xydata2.behavior_report_detail &&
              xydata2.behavior_report_detail.B22170014}
          </Descriptions.Item>
          <Descriptions.Item label="近12个月贷款金额在1w以上的笔数">
            {xydata2.behavior_report_detail &&
              xydata2.behavior_report_detail.B22170015}
          </Descriptions.Item>
          <Descriptions.Item label="近12个月消金类贷款机构数">
            {xydata2.behavior_report_detail &&
              xydata2.behavior_report_detail.B22170021}
          </Descriptions.Item>
          <Descriptions.Item label="近24个月消金类贷款机构数">
            {xydata2.behavior_report_detail &&
              xydata2.behavior_report_detail.B22170022}
          </Descriptions.Item>
          <Descriptions.Item label="近12个月网贷类贷款机构数">
            {xydata2.behavior_report_detail &&
              xydata2.behavior_report_detail.B22170023}
          </Descriptions.Item>
          <Descriptions.Item label="近24个月网贷类贷款机构数" span={2}>
            {xydata2.behavior_report_detail &&
              xydata2.behavior_report_detail.B22170024}
          </Descriptions.Item>
          <Descriptions.Item label="近6个月M0+逾期贷款笔数">
            {xydata2.behavior_report_detail &&
              xydata2.behavior_report_detail.B22170025}
          </Descriptions.Item>
          <Descriptions.Item label="近12个月M0+逾期贷款笔数">
            {xydata2.behavior_report_detail &&
              xydata2.behavior_report_detail.B22170026}
          </Descriptions.Item>
          <Descriptions.Item label="近24个月M0+逾期贷款笔数">
            {xydata2.behavior_report_detail &&
              xydata2.behavior_report_detail.B22170027}
          </Descriptions.Item>
          <Descriptions.Item label="近6个月M1+逾期贷款笔数">
            {xydata2.behavior_report_detail &&
              xydata2.behavior_report_detail.B22170028}
          </Descriptions.Item>
          <Descriptions.Item label="近12个月M1+逾期贷款笔数">
            {xydata2.behavior_report_detail &&
              xydata2.behavior_report_detail.B22170029}
          </Descriptions.Item>
          <Descriptions.Item label="近24个月M1+逾期贷款笔数">
            {xydata2.behavior_report_detail &&
              xydata2.behavior_report_detail.B22170030}
          </Descriptions.Item>
          <Descriptions.Item label="近6个月累计逾期金额">
            {xydata2.behavior_report_detail &&
              xydata2.behavior_report_detail.B22170031}
          </Descriptions.Item>
          <Descriptions.Item label="近12个月累计逾期金额">
            {xydata2.behavior_report_detail &&
              xydata2.behavior_report_detail.B22170032}
          </Descriptions.Item>
          <Descriptions.Item label="近24个月累计逾期金额">
            {xydata2.behavior_report_detail &&
              xydata2.behavior_report_detail.B22170033}
          </Descriptions.Item>
          <Descriptions.Item label="近1个月失败扣款笔数">
            {xydata2.behavior_report_detail &&
              xydata2.behavior_report_detail.B22170035}
          </Descriptions.Item>
          <Descriptions.Item label="近3个月失败扣款笔数">
            {xydata2.behavior_report_detail &&
              xydata2.behavior_report_detail.B22170036}
          </Descriptions.Item>
          <Descriptions.Item label="近6个月失败扣款笔数">
            {xydata2.behavior_report_detail &&
              xydata2.behavior_report_detail.B22170037}
          </Descriptions.Item>
          <Descriptions.Item label="近12个月失败扣款笔数">
            {xydata2.behavior_report_detail &&
              xydata2.behavior_report_detail.B22170038}
          </Descriptions.Item>
          <Descriptions.Item label="近24个月失败扣款笔数" span={2}>
            {xydata2.behavior_report_detail &&
              xydata2.behavior_report_detail.B22170039}
          </Descriptions.Item>
          <Descriptions.Item label="近1个月履约贷款总金额">
            {xydata2.behavior_report_detail &&
              xydata2.behavior_report_detail.B22170040}
          </Descriptions.Item>
          <Descriptions.Item label="近3个月履约贷款总金额">
            {xydata2.behavior_report_detail &&
              xydata2.behavior_report_detail.B22170041}
          </Descriptions.Item>
          <Descriptions.Item label="近6个月履约贷款总金额">
            {xydata2.behavior_report_detail &&
              xydata2.behavior_report_detail.B22170042}
          </Descriptions.Item>
          <Descriptions.Item label="近12个月履约贷款总金额">
            {xydata2.behavior_report_detail &&
              xydata2.behavior_report_detail.B22170043}
          </Descriptions.Item>
          <Descriptions.Item label="近24个月履约贷款总金额" span={2}>
            {xydata2.behavior_report_detail &&
              xydata2.behavior_report_detail.B22170044}
          </Descriptions.Item>
          <Descriptions.Item label="近1个月履约贷款次数">
            {xydata2.behavior_report_detail &&
              xydata2.behavior_report_detail.B22170045}
          </Descriptions.Item>
          <Descriptions.Item label="近3个月履约贷款次数">
            {xydata2.behavior_report_detail &&
              xydata2.behavior_report_detail.B22170046}
          </Descriptions.Item>
          <Descriptions.Item label="近6个月履约贷款次数">
            {xydata2.behavior_report_detail &&
              xydata2.behavior_report_detail.B22170047}
          </Descriptions.Item>
          <Descriptions.Item label="近12个月履约贷款次数">
            {xydata2.behavior_report_detail &&
              xydata2.behavior_report_detail.B22170048}
          </Descriptions.Item>
          <Descriptions.Item label="近24个月履约贷款次数" span={2}>
            {xydata2.behavior_report_detail &&
              xydata2.behavior_report_detail.B22170049}
          </Descriptions.Item>
          <Descriptions.Item label="最近一次履约距今天数">
            {xydata2.behavior_report_detail &&
              xydata2.behavior_report_detail.B22170050}
          </Descriptions.Item>
          <Descriptions.Item label="贷款已结清订单数">
            {xydata2.behavior_report_detail &&
              xydata2.behavior_report_detail.B22170052}
          </Descriptions.Item>
          <Descriptions.Item label="信用贷款时长">
            {xydata2.behavior_report_detail &&
              xydata2.behavior_report_detail.B22170053}
          </Descriptions.Item>
          <Descriptions.Item label="最近一次贷款放款时间">
            {xydata2.behavior_report_detail &&
              xydata2.behavior_report_detail.B22170054}
          </Descriptions.Item>
        </Descriptions>

        <Divider style={{ fontSize: '20px', marginTop: 50 }}>
          信用现状报告
        </Divider>
        <Descriptions column={3}>
          <Descriptions.Item label="网贷授信额度">
            {xydata2.current_report_detail &&
              xydata2.current_report_detail.C22180001}
          </Descriptions.Item>
          <Descriptions.Item label="网贷额度置信度">
            {xydata2.current_report_detail &&
              xydata2.current_report_detail.C22180002}
          </Descriptions.Item>
          <Descriptions.Item label="网络贷款类机构数">
            {xydata2.current_report_detail &&
              xydata2.current_report_detail.C22180003}
          </Descriptions.Item>
          <Descriptions.Item label="网络贷款类产品数">
            {xydata2.current_report_detail &&
              xydata2.current_report_detail.C22180004}
          </Descriptions.Item>
          <Descriptions.Item label="网络贷款机构最大授信额度">
            {xydata2.current_report_detail &&
              xydata2.current_report_detail.C22180005}
          </Descriptions.Item>
          <Descriptions.Item label="网络贷款机构平均授信额度">
            {xydata2.current_report_detail &&
              xydata2.current_report_detail.C22180006}
          </Descriptions.Item>
          <Descriptions.Item label="消金贷款类机构数">
            {xydata2.current_report_detail &&
              xydata2.current_report_detail.C22180007}
          </Descriptions.Item>
          <Descriptions.Item label="消金贷款类产品数">
            {xydata2.current_report_detail &&
              xydata2.current_report_detail.C22180008}
          </Descriptions.Item>
          <Descriptions.Item label="消金贷款类机构最大授信额度">
            {xydata2.current_report_detail &&
              xydata2.current_report_detail.C22180009}
          </Descriptions.Item>
          <Descriptions.Item label="消金贷款类机构平均授信额度">
            {xydata2.current_report_detail &&
              xydata2.current_report_detail.C22180010}
          </Descriptions.Item>
          <Descriptions.Item label="消金建议授信额度">
            {xydata2.current_report_detail &&
              xydata2.current_report_detail.C22180011}
          </Descriptions.Item>
          <Descriptions.Item label="消金额度置信度">
            {xydata2.current_report_detail &&
              xydata2.current_report_detail.C22180012}
          </Descriptions.Item>
        </Descriptions>
      </>
    )
  }
}

export default XinyanReport
